package com.reny.ll.git.mvvm

import android.view.View
import androidx.databinding.ViewDataBinding
import com.reny.ll.git.core.RLazyFragment
import com.reny.ll.git.mvvm.state.LoadState
import com.reny.ll.git.mvvm.view.IStateView

abstract class MvvmFragment<VB : ViewDataBinding>: RLazyFragment<VB>(), MvvmView {

    override fun rootView(): View = binding.root

    override fun getStateView(@LoadState state: Int): IStateView? = delegateImp.getStateView(state)

    override val emptyRetry: Boolean = true

    override val delegateImp: MvvmDelegateImp by lazy{
        MvvmDelegateImp(this)
    }

    override fun initCommonView() {
        delegateImp.initCommonView()

        initView()
    }

}